/*=============================================================================
#     FileName: 大数.cpp
#         Desc: 包括了大数乘法、大数阶乘
#       Author: Ace
#        Email: goace@acm.org
#     HomePage: http://www.goace.co.cc
#      Version: 0.0.1
#   LastChange: 2011-08-30 20:38:02
#      History:
=============================================================================*/
#include  <iostream>
#include  <vector>
#include  <string>
#include  <cstring>
#include  <cstdlib>
using namespace std;

/* ---------------------------------------------------------------*/
/**
 * 函数简介:  大数乘法
 *
 * 参数: a 乘数，同时存储相乘结果
 * 参数: b 被乘数
 */
/* ---------------------------------------------------------------*/
void multiply (vector<int> &a, vector<int> &b)
{
	vector<int> c(a.size() + b.size() - 1, 0);
	
	for(int i = a.size()-1; i >= 0 ; --i)
		for(int j = b.size()-1; j >= 0; --j)
			c[i+j] += a[i] * b[j];

	for(int i = c.size()-1; i > 0; i--)
		if(c[i] > 9)
		{
			c[i-1] += c[i]/10;
			c[i] %= 10;
		}

	if(c[0] > 9)
	{
		int temp = c[0]/10;
		c[0] %= 10;
		c.insert(c.begin(),temp);
	}
	a = c;
}


/* ---------------------------------------------------------------*/
/**
 * 函数简介:  计算n的阶乘
 *
 * 参数: n 
 */
/* ---------------------------------------------------------------*/
void jiecheng(int n)
{
	char s[10];
	sprintf(s,"%d",n);
	vector<int> sum;
	for(int i = 0; i < strlen(s); ++i)
		sum.push_back(s[i] - '0');

	n--;
	for( ; n > 0; --n)
	{
		sprintf(s,"%d",n);
		vector<int> tmp;
		for(int i = 0; i < strlen(s); ++i)
			tmp.push_back(s[i] - '0');
		multiply(sum,tmp);
	}

	for(int i = 0; i < sum.size(); ++i)
		cout << sum[i];
	cout << endl;
}

int main(int argc, char *argv[])
{
	int n;
	cin >> n;
	jiecheng(n);
}
